BreakBlk

General Control Statement

Syntax samples

BREAKBLK

Description

Exits from the innermost statement block. The next statement to be executed will be the one immediately following the END statement of the innermost statement block. If a BREAKBLK is executed outside any statement block, ProModel will exit the logic completely.

Valid In

Any logic.

Example

This example uses BREAKBLK in the logic for a shipping department that handles two types of entities, Letters and Packages. Both packages and letters need to be addressed, but packages may need to be wrapped before they are addressed. When a package arrives, shipping increments the variable No_of_Pkg to keep track of the number of packages it ships. Attr1 is then checked to see if the package has been wrapped. If the package has been wrapped (if Attr1 = 1), the BREAKBLK statement exits the statement block that wraps packages. If the package has not been wrapped, a resource, Wrapper, wraps the package. Finally, all entities that Shipping processes are addressed by the same statement and routed to the location Post_Office. The line
"// Breakblk to here" is a comment which marks the next statement executed after the BREAKBLK.

Process Table

Entity

Location

Operation (min)

ALL

Shipping

IF ENTITY() = Letter THEN

INC No_of_Let

IF ENTITY() = Pkg THEN

BEGIN

INC No_of_Pkg

IF Attr1 = 1 THEN

BREAKBLK

USE Wrapper FOR 8

Attr1 = 1

END

//Breakblk to here

USE Addresser FOR 3

Routing Table

Blk

Output

Destination

Rule

Move Logic

1

ALL

Post_Office

FIRST 1

MOVE FOR 5

See Also

BREAK.